import pygame
image=pygame.image.load("canopy.jpg")
image.set_colorkey((137,44,75))
import Platform

class Canopy(Platform.Platform):
	def __init__(self,pos=(0,0),im=image):
		Platform.Platform.__init__(self,pos,im)
	def drawingInformation(self):
		return self.pos,self.image
	def yLanding(self,objecto):
		x1=objecto.intermediate_x(self.pos[1])
		if self.within_x_boundary(x1,objecto.getWidth()) and (objecto.y<=self.pos[1]<=objecto.prev_y+objecto.getHeight()):
			objecto.bounceY(x1,self.pos[1])
	def within_x_boundary(self,ox,ow):
		return Platform.Platform.within_x_boundary(self,ox,ow)
	def hasFallenOff_y(self,objecto):
		if not self.within_x_boundary(objecto.x,objecto.getWidth()):
			self.unbound(objecto)
	def xLanding(self,objecto):
		pass
	def pointOfPlatform(self,x,y):
		return y==self.pos[1] and self.within_x_boundary(x,0)